package com.ycp.erp.employee.ui.activity;

import android.widget.RelativeLayout;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.one.common.config.RouterPath;
import com.one.common.model.extra.DefaultExtra;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.widget.MyTitleBar;
import com.ycp.erp.R;
import com.ycp.erp.employee.model.bean.Employee;

import butterknife.BindView;

/**
 * Class Des:员工详情
 * Created by bjh on 2021/9/16.
 */
@Route(path = RouterPath.EMPLOYEE_DETAIL)
public class EmployeeDetailActivity extends BaseActivity {
    @BindView(R.id.tvUserName)
    TextView tvUserName;
    @BindView(R.id.tvName)
    TextView tvName;
    @BindView(R.id.tvEmail)
    TextView tvEmail;
    @BindView(R.id.tvPhone)
    TextView tvPhone;
    @BindView(R.id.tvSex)
    TextView tvSex;
    @BindView(R.id.rlSex)
    RelativeLayout rlSex;
    @BindView(R.id.tvRole)
    TextView tvRole;
    @BindView(R.id.rlRole)
    RelativeLayout rlRole;
    @BindView(R.id.tvRemarks)
    TextView tvRemarks;

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void initTitle() {
        super.initTitle();
        getMyTitleBar().setMode(MyTitleBar.Mode.BACK_TITLE)
                .setTitleText("员工详情").hideLine();
    }

    @Override
    public void initData() {
        super.initData();
        DefaultExtra defaultExtra= (DefaultExtra) getIntent().getSerializableExtra(DefaultExtra.getExtraName());
        Employee employee=  (Employee)defaultExtra.getObj();
        if (employee!=null){
            tvUserName.setText(employee.getNamePY());
            tvName.setText(employee.getName());
            tvRole.setText(employee.getRoleName());
            tvPhone.setText(employee.getPhone());
        }
    }

    @Override
    public int getLayoutResId() {
        return R.layout.activity_employee_detail;
    }
}
